<%@page contentType="text/html;charset=utf-8"%>
<%@include file="../../core/common.jsp"%>
<html>
<head>
<title></title>
</head>
<script>
	function cpbh_(value, row, index) {
		if (row.cpmx.length > 0) {
			var a = '<div class="p-t-5">';
			for (var i = 0; i < row.cpmx.length; i++) {
				a += '<div class="p-b-5">' + row.cpmx[i].cpbh + '</div>';
			}
			a += '</div>';
			return a;
		}
	}
	function zl_(value, row, index) {
		if (row.cpmx.length > 0) {
			var a = '<div class="p-t-5">';
			for (var i = 0; i < row.cpmx.length; i++) {
				a += '<div class="p-b-5">' + row.cpmx[i].zl + '</div>';
			}
			a += '</div>';
			return a;
		}
	}
	function ks_(value, row, index) {
		if (row.cpmx.length > 0) {
			var a = '<div class="p-t-5">';
			for (var i = 0; i < row.cpmx.length; i++) {
				a += '<div class="p-b-5">' + row.cpmx[i].ks + '</div>';
			}
			a += '</div>';
			return a;
		}
	}
</script>
<body>
	<div id="tb" class="toolbar">
		<form id="fm">
			<table class="form-layout w80">
				<tr>
					<td>仓库名称：</td>
					<td><input name="search_ckmc" class="easyui-combobox" data-options="url:'${CTX}/mgt/t/ck/option',editable:false,formatter:''" /></td>
					<td>规格型号：</td>
					<td><input name="search_ggxh" class="easyui-combobox" data-options="url:'${CTX}/mgt/sys/dict/value/ph',editable:false,formatter:''" /></td>
					<td>库区名称：</td>
					<td><input name="search_kqmc" class="easyui-textbox" /></td>
					<td>库区状态：</td>
					<td><input name="search_kqzt" class="easyui-combobox" data-options="url:'${CTX}/mgt/sys/dict/option/kqzt',editable:false,formatter:''" /></td>
				</tr>
			</table>
		</form>
		<div style="float: left;">
			<shiro:hasPermission name="kcmx:dc">
				<a id="dc" class="form-btn success">
					<i class="fa fa-file-excel-o m-r-5"></i>导出
				</a>
			</shiro:hasPermission>
		</div>
		<div style="float: right;">
			<a id="find" class="form-btn success">
				<i class="fa fa-search m-r-5"></i>查询
			</a>
			<a id="reset" class="form-btn default">
				<i class="fa fa-undo m-r-5"></i>重置
			</a>
		</div>
		<div style="clear: both;"></div>
	</div>
	<table id="dg" class="easyui-datagrid" data-options="url:'${CTX}/mgt/t/kcmx/find',toolbar:'#tb'">
		<thead>
			<tr>
				<th data-options="field:'ckmc',width:100">仓库名称</th>
				<th data-options="field:'ggxh',width:100">规格型号</th>
				<th data-options="field:'kqmc',width:100">库区名称</th>
				<th data-options="field:'kqzt',width:100">库区状态</th>
				<th data-options="field:'cpbh',width:200,formatter:cpbh_">产品编号</th>
				<th data-options="field:'zl',width:100,formatter:zl_">重量(kg)</th>
				<th data-options="field:'ks',width:100,formatter:ks_">捆数</th>
			</tr>
		</thead>
	</table>
</body>
<script>
	$(function() {
		$('#find').click(function() {
			$('#dg').datagrid('reload', $('#fm').serializeObject());
		});
		$('#reset').click(function() {
			$('#fm').form('reset');
			$('#find').click();
		});
	});
	$('#dc').click(function() {
		window.location.href = '${CTX}/mgt/t/kcmx/dc';
	});
</script>
</html>